package com.nongye.system.service.impl;

import java.util.List;
import com.nongye.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.nongye.system.mapper.NyDictMapper;
import com.nongye.system.domain.NyDict;
import com.nongye.system.service.INyDictService;

/**
 * 农产品字典Service业务层处理
 * 
 * @author nongye
 * @date 2023-09-19
 */
@Service
public class NyDictServiceImpl implements INyDictService 
{
    @Autowired
    private NyDictMapper nyDictMapper;

    /**
     * 查询农产品字典
     * 
     * @param id 农产品字典主键
     * @return 农产品字典
     */
    @Override
    public NyDict selectNyDictById(Long id)
    {
        return nyDictMapper.selectNyDictById(id);
    }

    /**
     * 查询农产品字典列表
     * 
     * @param nyDict 农产品字典
     * @return 农产品字典
     */
    @Override
    public List<NyDict> selectNyDictList(NyDict nyDict)
    {
        return nyDictMapper.selectNyDictList(nyDict);
    }

    /**
     * 新增农产品字典
     * 
     * @param nyDict 农产品字典
     * @return 结果
     */
    @Override
    public int insertNyDict(NyDict nyDict)
    {
        nyDict.setCreateTime(DateUtils.getNowDate());
        return nyDictMapper.insertNyDict(nyDict);
    }

    /**
     * 修改农产品字典
     * 
     * @param nyDict 农产品字典
     * @return 结果
     */
    @Override
    public int updateNyDict(NyDict nyDict)
    {
        return nyDictMapper.updateNyDict(nyDict);
    }

    /**
     * 批量删除农产品字典
     * 
     * @param ids 需要删除的农产品字典主键
     * @return 结果
     */
    @Override
    public int deleteNyDictByIds(Long[] ids)
    {
        return nyDictMapper.deleteNyDictByIds(ids);
    }

    /**
     * 删除农产品字典信息
     * 
     * @param id 农产品字典主键
     * @return 结果
     */
    @Override
    public int deleteNyDictById(Long id)
    {
        return nyDictMapper.deleteNyDictById(id);
    }
}
